package com.itheima.jdbc.lianxi;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class Test1 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //1 注册驱动
        Class.forName("com.mysql.jdbc.Driver");
        //2,获取链接
        String url="jdbc:mysql://192.168.36.74/db1?useSSL=false";
        String uesr="root";
        String password="1234";
        Connection connection = DriverManager.getConnection(url, uesr, password);
        String sql="update emp set salary=18000 where ename='孙悟空'";
        Statement statement = connection.createStatement();
        int i = statement.executeUpdate(sql);
        System.out.println(i);
        statement.close();
        connection.close();
    }
}
